package cre.jdk8.stream;

import com.google.common.collect.Lists;

import java.util.List;

/**
 * @Author gucb
 * @Date 2017/5/10.
 */
public class StreamTest {

    public static void main(String[] args) {
        List<Integer> ints = Lists.newArrayList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
        System.out.println(ints);

        int sum2 = ints.stream().map(n -> 2 * n).reduce((sum, item) -> sum + item).get();
        System.out.println(sum2);
    }
}
